﻿using System;
using System.Collections.Generic;
using System.Data.Linq;

namespace PD.DataAccess
{
    /// <summary>
    /// Provides data for entity updated event.
    /// </summary>
    /// <typeparam name="T">Type of updated entity.</typeparam>
    public class EntityUpdatedEventArgs<T> : EventArgs where T : EntityBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EntityUpdatedEventArgs&lt;T&gt;"/> class.
        /// </summary>
        /// <param name="modifiedMembers">The modified members.</param>
        /// <param name="after">The after.</param>
        public EntityUpdatedEventArgs(IEnumerable<ModifiedMemberInfo> modifiedMembers, T after)
        {
            this.ModifiedMenbers = modifiedMembers ?? new List<ModifiedMemberInfo>();
            this.After = after;
        }

        /// <summary>
        /// Gets the modified menbers.
        /// </summary>
        public IEnumerable<ModifiedMemberInfo> ModifiedMenbers { get; private set; }

        /// <summary>
        /// Gets the after instance.
        /// </summary>
        public T After { get; private set; }
    }
}
